package com.bsoft.gol.hcs.enumcase;

/**
 * @author tongtp
 * @version v0.1
 * @package enumcase
 * @className RuleLineTypeEnum
 * @description 规则连接类型
 * @create 2021-08-09 14:43
 **/
public enum RuleLineTypeEnum {

	//规则连接类型：1 and 2 or
	AND((byte) 1, "AND"),
	OR((byte) 2, "OR");

	private final Byte type;

	private final String name;

	RuleLineTypeEnum(Byte type, String name) {
		this.type = type;
		this.name = name;
	}

	public static RuleLineTypeEnum getEnumByKey(Byte type) {
		for (RuleLineTypeEnum temp : RuleLineTypeEnum.values()) {
			if (temp.getType().equals(type)) {
				return temp;
			}
		}
		return null;
	}

	public Byte getType() {
		return type;
	}

	public String getName() {
		return name;
	}
}
